﻿//***********************************************************************
//* Module:  TbBstCarBLL.cs
// * 作者:  曹荣芝
//* Modified: 2013-05-09
// * Purpose: Definition of the Class XWG.JWBST.AuthBLL.TbBstCarBLL
// ***********************************************************************/
using System;
using System.Data;
using XWG.JWBST;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using XWG.JWBST.JWBSTEntity;
using XWG.Framework.AuthUtility;
namespace XWG.JWBST.JWBSTBLL
{
    /// <summary>
    /// 
    /// </summary>
    public class TbBstCarBLL
    {
        #region 删除操作
        /// <summary>
        /// 删除。
        /// </summary>
        /// <param name="carpkid">要删除的的主键值。</param>
        /// <param name="userid">操作员。</param>
        /// <param name="isLog">是否写入日志。</param>
        /// <returns>是否成功 1 表示成功 负值代表失败</returns>
        public static ResultModel Delete(object carpkid, object userid, bool isLog)
        {
            return JWBSTDAL.TbBstCarDAL.Delete(carpkid, userid, isLog);
        }
        #endregion
        #region 根据主键查询一条记录
        /// <summary>
        /// 获取实体
        /// </summary>
        /// <param name="carpkid">主键</param>
        /// <returns>用户实体</returns>
        public static TbBstCar Load(object carpkid)
        {
            return JWBSTDAL.TbBstCarDAL.Load(carpkid);
        }
        #endregion
        #region 查询操作
        /// <summary>
        /// 查询
        /// </summary>
        public static IList<TbBstCar> SelectList()
        {
            return JWBSTDAL.TbBstCarDAL.SelectList();
        }
        #endregion
        #region 插入操作
        /// <summary>
        /// 新增。
        /// </summary>
        /// <param name="info">待新增的信息。</param>
        /// <param name="userid">操作员。</param>
        /// <param name="isLog">是否写入日志。</param>
        /// <returns>新增是否成功的标示。（1：成功；负值失败）</returns>
        public static ResultModel Insert(TbBstCar info, object userid, bool isLog)
        {
            return JWBSTDAL.TbBstCarDAL.Insert(info, userid, isLog);
        }
        #endregion
        #region 修改操作
        /// <summary>
        /// 修改。
        /// </summary>
        /// <param name="info">待修改的信息。</param>
        /// <param name="userid">操作员。</param>
        /// <param name="isLog">是否写入日志。</param>
        /// <returns>修改是否成功的标示。（1：成功；负值失败）</returns>
        public static ResultModel Update(TbBstCar info, object userid, bool isLog)
        {
            return JWBSTDAL.TbBstCarDAL.Update(info, userid, isLog);
        }
        #endregion
        #region 检验车辆数量
        /// <summary>
        /// 根据用户ID判断是车辆是否超过3辆
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public static bool CheckNum(string userid, int num)
        {
            return XWG.JWBST.JWBSTDAL.TbBstCarDAL.CheckNum(userid, num);
        }
        #endregion
        #region 重复录入检测
        public static bool CheckRepeat(string userid, string carlicense)
        {
            return XWG.JWBST.JWBSTDAL.TbBstCarDAL.CheckRepeat(userid, carlicense);
        }
        #endregion
        #region 查询该用户名下车辆审核状态
        /// <summary>
        /// 根据ID查找该ID下所有车辆审核信息
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public static List<TbBstCar> CheckCarByUserID(string userID)
        {
            return XWG.JWBST.JWBSTDAL.TbBstCarDAL.CheckCarByUserID(userID);
        }
        
        /// <summary>
        /// 根据ID和审核状态 查找该ID下所有车辆
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="audit"></param>
        /// <returns></returns>
        public static List<TbBstCar> CheckCarByUserIDAndAudit(string userID, string audit)
        {
            return XWG.JWBST.JWBSTDAL.TbBstCarDAL.CheckCarByUserIDAndAudit(userID, audit);
        }

        ///// <summary>
        ///// 根据用户名和车牌号查询该车是否通过审核
        ///// </summary>
        ///// <param name="userID"></param>
        ///// <param name="Carno"></param>
        ///// <returns></returns>
        //public static int IsAudit(string userID, string Carno)
        //{
        //    return XWG.JWBST.JWBSTDAL.TbBstCarDAL.IsAudit(userID, Carno);
        //}
        #endregion
    }
}
